import TableColumnFilter from "@/components/TableColumnFilter/index.vue";
const tableColumnFilterMixin = {
  components: { TableColumnFilter },
  data() {
    return {
      filterParams: {} // 筛选参数
    }
  },
  methods: {
    // 提交筛选
    executeFilter() {
      // console.log(this.filterParams)
      // let condition = this.handleFilterCondition()
      // console.log(condition)
      this.handleSearch(); // 查询表格数据
    },
    // 处理筛选条件
    handleFilterCondition() {
      let { filterParams } = this;
      let condition = [];
      for (const key in filterParams) {
        let filterObj = {
          name: key,
          symbol: filterParams[key].filterCondition,
          value: filterParams[key].filterVal
        }
        condition.push(filterObj)
      }
      return condition
    }
  },
}

export default tableColumnFilterMixin;